<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<jsp:include page="../top.jsp"></jsp:include>

    <script src="shared/js/time/mobiscroll_002.js" type="text/javascript"></script>
	<script src="shared/js/time/mobiscroll_004.js" type="text/javascript"></script>
	<link href="shared/css/mobiscroll_002.css" rel="stylesheet" type="text/css">
	<link href="shared/css/mobiscroll.css" rel="stylesheet" type="text/css">
	<script src="shared/js/time/mobiscroll.js" type="text/javascript"></script>
	<script src="shared/js/time/mobiscroll_003.js" type="text/javascript"></script>
	<script src="shared/js/time/mobiscroll_005.js" type="text/javascript"></script>
	<link href="shared/css/mobiscroll_003.css" rel="stylesheet" type="text/css">
	<script type="text/javascript">
        $(function () {
			var currYear = (new Date()).getFullYear();	
			var opt={};
			opt.date = {preset : 'date'};
			opt.datetime = {preset : 'datetime'};
			opt.time = {preset : 'time'};
			opt.default = {
				theme: 'android-ics light', //皮肤样式
		        display: 'modal', //显示方式 
		        mode: 'scroller', //日期选择模式
				dateFormat: 'yyyy-mm-dd',
				lang: 'zh',
				showNow: true,
				nowText: "今天",
		        startYear: currYear - 10, //开始年份
		        endYear: currYear + 10 //结束年份
			};

		  	var optDateTime = $.extend(opt['datetime'], opt['default']);
		    $("#projInviteEndTimeSplit").mobiscroll($.extend(opt['date'], opt['default']));
		    $("#projInviteStartTimeSplit").mobiscroll($.extend(opt['date'], opt['default']));
		   	$("#inviteLocationCode0").unbind("change", eDropLangChange).bind("change", eDropLangChange); 
			$("#inviteLocationCode").unbind("change", eDropFrameChange).bind("change", eDropFrameChange); 
        });
        function al(){
        	alert("appDateTime:" + $("#appDateTime").attr("value"));
        }
        
        
        
		var eDropLangChange = function(){ 
			var selectedValue = $(this).val(); 
			$("#inviteLocationCode").children("span").each(function(){ 
				$(this).children().clone().replaceAll($(this)); 
			}); 
	
			if(parseInt(selectedValue) != 0){ 
				$("#inviteLocationCode").children("option[parentid!='" + selectedValue + "'][value!='0']").each(function(){ 
					$(this).wrap("<span style='display:none'></span>"); 
				}); 
			} 
		}; 
		var eDropFrameChange = function(){  
			$("#inviteLocationCode0").val($(this).children("option:selected").attr("parentid")); 
		}; 
	
        
        
        
        
        
        
        
        
    </script> 


<!-- START:wrapper -->
<div id="wrapper">
<!-- InstanceBeginEditable name="wrapper" -->

<!-- START:wrapper-fff -->
<div class="wrapper-fff">

<!-- START:main -->
<div id="main">

<!-- START:tender -->
<div class="tender">

<div class="tender-tit"><img src="shared/images/tender_tit.gif" width="1170" height="79" alt="img" /></div>

<!-- START:zbrz-info -->
<div class="zbrz-info">

<script>
<!--
/*第一种形式 第二种形式 更换显示样式*/
    function setTab(name,cursel,n){
    for(i=1;i<=n;i++){
    var menu=document.getElementById(name+i);
    var con=document.getElementById("con_"+name+"_"+i);
    menu.className=i==cursel?"hover":"";
    con.style.display=i==cursel?"block":"none";
    }
    }
//-->
</script>

<!-- START:zbrz-tab -->
<div id="zbrz-tab">

<!-- START:tab-menu -->
<div class="tab-menu">
<ul>
<li id="one1" onclick="setTab('one',1,2)" class="hover"><input name="" type="radio" value="" />&nbsp;委托分标</li>
<li id="one2" onclick="setTab('one',2,2)" ><input name="" type="radio" value="" />&nbsp;自主分标</li>
</ul>
</div>
<!-- END:tab-menu -->

<!-- START:zbrz-tab-con -->
<div class="zbrz-tab-con">
<script type="text/javascript">
function checkForm(){
	//alert("this is a checkForm javascript");
	document.getElementById("wqtoffbzf").style.display="block";
	document.getElementById("wqtoffbzs").style.display="none"; 
	$("#errmsg1").empty();
	var param =$.serializeObject($("#wqtoTenderForm"));
	var projName = param["projName"]
  	if(projName == ""){
		$("#errmsg1").append("<font color=red> 您的项目名称为空，请仔细填写!</font>");
		$("#projName").focus();
		return;
	}
	var projDesc = param["projDesc"]
	if(projDesc == ""){
		$("#errmsg1").append("<font color=red> 您的项目描述为空，请仔细填写!</font>");
		$("#projDesc").focus();
		return;
	}
	var agree1 = param["agree1"]
	if(agree1 == undefined){
		$("#errmsg1").append("<font color=red> 您没有勾选声明，请仔细填写!</font>");
		$("#agree1").focus();
		return;
	}
	
 	document.getElementById("wqtoffbzf").style.display="none";
	document.getElementById("wqtoffbzs").style.display="block"; 

}

function checkForm2(){
	//alert("this is a checkForm javascript2");
	document.getElementById("zizuffbzf").style.display="block";
	document.getElementById("zizuffbzs").style.display="none"; 
	$("#errmsg2").empty();
	var param =$.serializeObject($("#zizuTenderForm"));
	var projNameSplit = param["projNameSplit"]
  	if(projNameSplit == ""){
		$("#errmsg2").append("<font color=red> 您的项目名称为空，请仔细填写!</font>");
		$("#projNameSplit").focus();
		return;
	}
	var projDescSplit = param["projDescSplit"]
	if(projDescSplit == ""){
		$("#errmsg2").append("<font color=red> 您的项目描述为空，请仔细填写!</font>");
		$("#projDescSplit").focus();
		return;
	}
	var agree2 = param["agree2"]
	if(agree2 == undefined){
		$("#errmsg2").append("<font color=red> 您没有勾选声明，请仔细填写!</font>");
		$("#agree2").focus();
		return;
	}
	
 	document.getElementById("zizuffbzf").style.display="none";
	document.getElementById("zizuffbzs").style.display="block"; 

}

function wtTender(){
	//alert("this is a checkForm javascript");
	$("#errmsg1").empty();
	document.getElementById("wqtoffbzf").style.display="block";
	document.getElementById("wqtoffbzs").style.display="none"; 
	var param =$.serializeObject($("#wqtoTenderForm"));
	var projName = param["projName"]
  	if(projName == ""){
		$("#errmsg1").append("<font color=red> 您的项目名称为空，请仔细填写!</font>");
		$("#projName").focus();
		return;
	}
	var projDesc = param["projDesc"]
	if(projDesc == ""){
		$("#errmsg1").append("<font color=red> 您的项目描述为空，请仔细填写!</font>");
		$("#projDesc").focus();
		return;
	}
	var agree1 = param["agree1"]
	if(agree1 == undefined){
		$("#errmsg1").append("<font color=red> 您没有勾选声明，请仔细填写!</font>");
		$("#agree1").focus();
		return;
	} 
	
	$.ajax({
		url: path+"/bid/wtTender.do",
		data: param,
		type : "POST",
		dataType: "json",
		success: function(result) {
			if(result.success){
				window.location=path+"/bid/tenderOK.do?email=";
			}else{
			alert("操作失败");
				//$("#errmsg").append("<font color=green> 您的用户名可用！</font>");
			}
		}
	}); 
}


function zzTender(){
	//alert("this is a checkForm javascript2");
	document.getElementById("zizuffbzf").style.display="block";
	document.getElementById("zizuffbzs").style.display="none"; 
	$("#errmsg2").empty();
	var param =$.serializeObject($("#zizuTenderForm"));
	var projNameSplit = param["projNameSplit"]
  	if(projNameSplit == ""){
		$("#errmsg2").append("<font color=red> 您的项目名称为空，请仔细填写!</font>");
		$("#projNameSplit").focus();
		return;
	}
	var projDescSplit = param["projDescSplit"]
	if(projDescSplit == ""){
		$("#errmsg2").append("<font color=red> 您的项目描述为空，请仔细填写!</font>");
		$("#projDescSplit").focus();
		return;
	}
	var agree2 = param["agree2"]
	if(agree2 == undefined){
		$("#errmsg2").append("<font color=red> 您没有勾选声明，请仔细填写!</font>");
		$("#agree2").focus();
		return;
	}
	
	$.ajax({
		url: path+"/bid/zzTender.do",
		data: param,
		type : "POST",
		dataType: "json",
		success: function(result) {
			if(result.success){
				window.location=path+"/bid/tenderOK.do?email=";
			}else{
				alert("操作失败");
				//$("#errmsg").append("<font color=green> 您的用户名可用！</font>");
			}
		}
	}); 
}

//表单提交新增失败后,返回回调函数,传回错误信息
	function uploadSucced(msg){
	//	var btn = $("#createPeriadBtn");
	//	btn.button('reset');
		$("#firstUploadSucceedMsg").html(msg);
		$("#firstUploadSucceed").show();
		$("#firstUploadFailed").hide();
		var strs = new Array();
		strs = msg.split("&");
		if(strs[1]=="4"){
			document.getElementById("tenderFileImg").src=path + strs[0];
		}
	}
	function uploadSucced2(msg){
	//	var btn = $("#createPeriadBtn");
	//	btn.button('reset');
		$("#firstUploadSucceedMsg2").html(msg);
		$("#firstUploadSucceed2").show();
		$("#firstUploadFailed2").hide();
		var strs = new Array();
		strs = msg.split("&");
		if(strs[1]=="4"){
			document.getElementById("tenderFileImg2").src=path + strs[0];
		}
		if(strs[1]=="5"){
			document.getElementById("tenderPicImg").src=path + strs[0];
		}
	}
	//表单提交修改失败后，传回提示信息
	function uploadFailed(msg){
	//	var btn = $("#updateperiadBtn");
	//	btn.button('reset');
		$("#firstUploadFailedMsg").html(msg);
		$("#firstUploadFailed").show();
		$("#firstUploadSucceed").hide();
	}
	function uploadFailed2(msg){
	//	var btn = $("#updateperiadBtn");
	//	btn.button('reset');
		$("#firstUploadFailedMsg2").html(msg);
		$("#firstUploadFailed2").show();
		$("#firstUploadSucceed2").hide();
	}
</script>
<!-- START:con_one_1 -->
<div id="con_one_1" class="hover">

<!-- START:tender-con -->
<div class="tender-con" style="text-align: center;">
	<form id="wqtoTenderForm">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tender-tabel">
		<tr>
		<th>项目名称：</th>
		<td><input name="projName" id="projName" type="text" class="zbrz-left-input" onblur="checkForm();"/></td>
		</tr>
		
		<tr>
		<th>招标方ID：</th>
		<td><input name="projInviteId" id="projInviteId" type="text" class="zbrz-left-input" value="${(!empty user)? user.userId : '1' }" readonly="readonly" onblur="checkForm();"/></td>
		</tr>
		
		<tr>
		<th>项目简介：</th>
		<td><textarea name="projDesc" id="projDesc" cols="45" rows="5" class="tender-textarea" onblur="checkForm();"></textarea></td>
		</tr>
		
		<!-- <tr>
		<th>上传招标文件：</th>
		<td><img src="shared/images/button_zbrz_up.gif" width="96" height="36" alt="img" />&nbsp;&nbsp;<span class="color-red-c32">*仅限.jpg格式或.gif格式</span></td>
		</tr> -->
		
		<tr>
		<th></th>
		<td><input name="agree1" id="agree1" type="checkbox" value="" onClick="checkForm();"/>&nbsp;我已阅读并同意《<a href="#" class="link-style-b">比蒙自主分标招标服务协议</a>》</td>
		</tr>
		</table>
		
		
	</form>
	<div style="height:20px;">   </div>
	<form id ="firstUpdateForm" action="<%=path%>/bid/uploadFile.do?imgType=4" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
		    上传招标文件:<input type="file" id="firstDemoImgFile" name="imgFile">
		    <br><img style="width:200px;" id="tenderFileImg" src="<%=path%>/img/test.jpg" /><br>
	    <button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button>
	</form> 
	<div id="firstUploadSucceed" style="display: none;">
	    <strong>文件上传成功！</strong></span>
	</div>
	<div id="firstUploadFailed" style="display: none;">
	    <strong>文件上传失败！</strong></span>
	</div>
	<iframe name='hidden_frame' id="hidden_frame" style='display:none'></iframe>
	<div id="wqtoffbzf" class="submit">
		
			<img src="shared/images/tender_submit_01.png" width="142" height="51" alt="img" />
		
		<div id="errmsg1"  style="color: #FFFFFF; font-size: 12px; text-align: center;"></div>
	</div>
	<div id="wqtoffbzs" style="display:none" class="submit">
		<a href="javascript:wtTender();">
			<img src="shared/images/tender_submit_01.gif" width="142" height="51" alt="img" />
		</a>
	</div>
</div>
<!-- END:zbrz-tab-con -->

</div>
<!-- END:con_one_1 -->

<!-- START:con_one_2 -->
<div id="con_one_2" style="display:none">

<!-- START:tender-con -->
<div class="tender-con" style="text-align: center;">
	<form id="zizuTenderForm">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tender-tabel">
		<tr>
		<th>项目名称：</th>
		<td><input name="projNameSplit" id="projNameSplit" type="text" class="tender-input" onblur="checkForm2();"/></td>
		</tr>
		
		<tr>
		<th>项目深度：</th>
		<td><select name="projDepthCodeSplit" class="temp-input">
		  <option>---选择---</option>
		   <c:if test="${!empty depthCodes}">
					<c:forEach var="cert" items="${depthCodes}">
						<option value="${cert.codeId }">${cert.codeName}</option>
					</c:forEach>
				</c:if>
		</select>
		</td>
		</tr>
		
		<tr>
		<th>专业内容：</th>
		<td>
			<select name="projTarCodeSplit" class="temp-input">
			  <option>---选择---</option>
			  <c:if test="${!empty targets}">
					<c:forEach var="cert" items="${targets}">
						<option value="${cert.targetCode }">${cert.targetName}</option>
					</c:forEach>
				</c:if>
			</select>
		</td>
		</tr>
		
		<tr>
		<th>招标企业资质：</th>
		<td>
		<c:if test="${!empty qualities}">
			<c:forEach var="cert" items="${qualities}">
				<input name="projBidOrgAptitudeSplit" type="radio" value="${cert.codeId }" />&nbsp;${cert.codeName}&nbsp;&nbsp;
			</c:forEach>
		</c:if>
		
		
<!-- 		<input name="" type="radio" value="" />&nbsp;不限&nbsp;&nbsp;
		<input name="" type="radio" value="" onblur="checkForm2();"/>&nbsp;明星企业&nbsp;&nbsp;
		<input name="" type="radio" value="" />&nbsp;普通企业 -->
		</td>
		</tr>
		
		<tr>
		<th>招标企业等级：</th>
		<td><img src="shared/images/ico_wuxing_5.png" width="132" height="21" alt="img" /></td>
		</tr>
		
		<tr>
		<th>招标周期：</th>
		<td>
			<input value="" class="" readonly="readonly" name="projInviteStartTimeSplit" id="projInviteStartTimeSplit" type="text">
			至
			<input value="" class="" readonly="readonly" name="projInviteEndTimeSplit" id="projInviteEndTimeSplit" type="text">
		</td>
		</tr>
		
		<tr>
		<th>招标预算：</th>
		<td><input name="projPremSplit" id="projPremSplit" value="0" type="text" class="tender-input" onblur="checkForm2();"/></td>
		</tr>
		
		<tr>
		<th>招标地点：</th>
		<td>
		
		
		<select id="inviteLocationCode0" name="inviteLocationCode0" class="temp-input"> 
				<option value="0" selected="selected">--省份--</option> 
				<c:if test="${!empty locations}">
					<c:forEach var="location" items="${locations}">
						<c:if test="${location.locationCode==location.pLocationCode}">
							<fmt:parseNumber var="prov" integerOnly="true" type="number" value="${(user.orgRegLocationCode/1000)}" />
							<c:if test="${location.locationCode==prov}">
								<option value="${location.locationCode}" selected="selected">${location.locationName}</option>
							</c:if>
							<c:if test="${location.locationCode!=prov}">
								<option value="${location.locationCode}">${location.locationName}</option>
							</c:if>
						</c:if>
					</c:forEach>
				</c:if> 
			</select> 
			<select id="inviteLocationCode" name="inviteLocationCode" class="temp-input"> 
				<option value="0" selected="selected">--城市-- </option>
				<c:if test="${!empty locations}">
					<c:forEach var="location" items="${locations}">
						<c:if test="${location.locationCode!=location.pLocationCode}">
							<c:if test="${location.locationCode==user.orgRegLocationCode }">
								<option value="${location.locationCode}" parentid="${location.pLocationCode}" selected="selected">${location.locationName}</option>
							</c:if>
							<c:if test="${location.locationCode!=user.orgRegLocationCode }">
								<option value="${location.locationCode}" parentid="${location.pLocationCode}" >${location.locationName}</option>
							</c:if>
						</c:if>
					</c:forEach>
				</c:if> 
			</select> 
		
		
		</td>
		</tr>
		
<!-- 		<tr>
		<th>招标文件：</th>
		<td><img src="shared/images/button_zbrz_up.gif" width="96" height="36" alt="img" />&nbsp;&nbsp;<span class="color-red-c32">*仅限.doc格式或.pdf格式</span></td>
		</tr>
		
		<tr>
		<th>招标图片：</th>
		<td><img src="shared/images/button_zbrz_up.gif" width="96" height="36" alt="img" />&nbsp;&nbsp;<span class="color-red-c32">*仅限.jpg格式或.gif格式</span></td>
		</tr> -->
		<tr>
		<th>项目简介：</th>
		<td><textarea name="projDescSplit" id="projDescSplit" cols="45" rows="5" class="tender-textarea" onblur="checkForm2();"></textarea></td>
		</tr>
		
		<tr>
		<th></th>
		<td><input name="agree2" id="agree2" type="checkbox" value="" onClick="checkForm2();"/>&nbsp;我已阅读并同意《<a href="#" class="link-style-b">比蒙自主分标招标服务协议</a>》</td>
		</tr>
		</table>
	</form>
	<div style="height:20px;">   </div>
	<form id ="firstUpdateForm" action="<%=path%>/bid/uploadFile.do?imgType=4&type=2" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
		    上传招标文件:<input type="file" id="firstDemoImgFile" name="imgFile">
		    <br><img style="width:200px;" id="tenderFileImg2" src="<%=path%>/img/test.jpg" /><br>
	    <button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button>
	</form> 
	<form id ="firstUpdateForm" action="<%=path%>/bid/uploadFile.do?imgType=5&type=2" method="post"
	    enctype="multipart/form-data" class="form-horizontal" role="form" target="hidden_frame">
		    上传招标文件:<input type="file" id="firstDemoImgFile" name="imgFile">
		    <br><img style="width:200px;" id="tenderPicImg" src="<%=path%>/img/test.jpg" /><br>
	    <button id="createPeriadBtn" type="submit" class="btn btn-default">上传</button>
	</form> 
	<div id="firstUploadSucceed2" style="display: none;">
	    <strong>文件上传成功！</strong></span>
	</div>
	<div id="firstUploadFailed2" style="display: none;">
	    <strong>文件上传失败！</strong></span>
	</div>
	<iframe name='hidden_frame' id="hidden_frame" style='display:none'></iframe>
	
	
	
	
	<div id="zizuffbzf" class="submit">
		
			<img src="shared/images/tender_submit_01.png" width="142" height="51" alt="img" />
		
		<div id="errmsg2"  style="color: #FFFFFF; font-size: 12px; text-align: center;"></div>
	</div>
	<div id="zizuffbzs" style="display:none" class="submit">
		<a href="javascript:zzTender();">
			<img src="shared/images/tender_submit_01.gif" width="142" height="51" alt="img" />
		</a>
	</div>

</div>
<!-- END:tender-con -->

</div>
<!-- END:con_one_2 -->

</div>
<!-- END:tender -->
  
</div>
<!-- END:zbrz-tab -->

</div>
<!-- END:zbrz-info -->

<!-- START:tender-faq -->
<div class="tender-faq">


<!-- START:tender-tab-faq -->
<div id="tender-tab-faq">

<!-- START:tab-menu -->
<div class="tab-menu2">
<ul>
<li id="two1" onclick="setTab('two',1,2)" class="hover">招标流程</li>
<li id="two2" onclick="setTab('two',2,2)" >招标常见问题</li>
</ul>
</div>
<!-- END:tab-menu -->

<!-- START:tender-tab-con -->
<div class="tender-tab-con">

<!-- START:con_two_1 -->
<div id="con_two_1" class="hover">

<ul class="zbrz-navi-fuwu">
<li>自主分标和委托分标有什么区别？</li>
<li>招标为什么会流标?</li>
<li>自主分标和委托分标有什么区别？</li>
<li>招标为什么会流标?</li>
</ul>

</div>
<!-- END:con_two_1 -->

<!-- START:con_two_2 -->
<div id="con_two_2" style="display:none">

<ul class="zbrz-navi-fuwu">
<li>招标为什么会流标?</li>
<li>自主分标和委托分标有什么区别？</li>
</ul>

</div>
<!-- END:con_two_2 -->

</div>
<!-- END:tender-tab-con -->
  
</div>
<!-- END:tender-tab-faq -->

</div>
<!-- END:tender-faq -->

</div>
<!-- END:tender -->

</div>
<!-- END:main -->

</div>
<!-- END:wrapper-fff -->

<!-- InstanceEndEditable -->
</div>
<!-- END:wrapper -->

<jsp:include page="../bottom.jsp"></jsp:include>